Page({
    data: {
        active: 0,

        documents: []
    },
    
    onLoad: function(options) {
        this.onReachBottom()
    },

    onReachBottom() {
        var self = this

        wx.request({
            url: 'https://www.srdb.com/document',
            success:function(res){
              self.setData({documents: self.data.documents.concat(res.data)})
            }
        })
    },

    onChange(event) {
        var self = this

        wx.request({
            url: 'https://www.srdb.com/document',
            success:function(res){
              self.setData({documents: res.data})
            }
        })
    }
})
  